home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / bmpkit.zip / BMPKIT.FRM (.txt) < prev    next >
Visual Basic Form  |  1991-10-06  |  8KB  |  180 lines

  1. Form1
  2. Form1
  3. Form1
  4. Picture1
  5. Label1
  6. Scaled Image
  7. Command1
  8. VScroll1
  9. Option1
  10. Picture2
  11. Option2
  12. HScroll1    
  13. Label2
  14. Label3
  15. Command2
  16. Display
  17. Command3
  18. Print
  19. Command5
  20. Hide Original
  21. Command4
  22. Show Original 
  23. Form_Click
  24. @    Form_Loadx
  25. Picture2
  26.     scalemode
  27. width
  28. height
  29. hscroll1S
  30. hscroll
  31. smallchange
  32. largechange<
  33. values
  34. vscroll1
  35. picture1
  36. visible
  37. PictureZ
  38. scalex)
  39. scaleyA
  40. command2_click
  41. Command1_Click
  42. picture3
  43. moveflag
  44.     scaleflag
  45. defaultmargin
  46. leftY
  47. SRCCOPY
  48. NEWFRAME/
  49. pixel
  50. graphicfile
  51. printer
  52. printgraphicx
  53. littlex
  54. printgraphicy
  55. littleyI
  56. scalewidth
  57. scaleheight
  58.     hMemoryDCe
  59. CreateCompatibleDC
  60. hOldBitMap
  61. SelectObject
  62. ApiError
  63. StretchBlt
  64. DeleteDC    
  65.     constants
  66. calls6
  67. Command3_Click
  68. requires
  69. coordinates
  70. graphic
  71. match
  72. current
  73. inchk
  74.     positionsR
  75.     invisible
  76. form1
  77. certain 
  78. factors
  79. Command4_Click
  80. Command5_ClickW
  81. HScroll1_Change
  82. option2?
  83. option1
  84. Check1_Click3
  85. check1
  86. xyproportion
  87. VScroll1_ChangeK
  88. above
  89. selected
  90. positive
  91. currentx
  92. currenty
  93.     drawwidth
  94. Form_Load
  95. *set form and picture ScaleModes
  96. set the Move optionn
  97. set initial picture width
  98. *Setup scroll bar values
  99. *Set Horizontal Scrollbar to center
  100. *Set Vertical Scrollbar to centere
  101. *Make Picture1 box invisible...This picture box, which
  102. holds the basic image, does not have to show.  Note that
  103. we'll use the printer resolution of this box for sizing.
  104. For example, a 300X300 pixel image will print as 1X1 inchh
  105. on a laser printer..
  106. *Load bitmap into Picture1 ... put PAPER.BMP, a Windowss
  107. background image in the VB directory, or in the defaultt
  108. directory, or change the filespec to match it's location.
  109. Choose your own, or let user load.
  110. RIBBONS.BMP"
  111. *Set scaling factors to 1 for full-size image.
  112. To reduce or enlarge the original when first displayed,
  113. change these figures.t
  114. *Display Picture in Picture2
  115. Command1_Click
  116. command2_click
  117. Make sure we have valid scaling values
  118. Set picture2.width to match picture1, with scaling.V
  119. The 3.14 divisor matches inch dimension with the
  120. 640X480 screen dimensions. Change for other displayy
  121. adapters..
  122. *Set constants for GDI calls
  123. *Display scaled version in Picture2a
  124. *StretchBlt requires pixel coordinates..
  125. Set Dimensions for Picture2c
  126. *Do not change the order of these statements.
  127. Variables for the StretchBlt function:
  128. 1. Source of image HMemeoryDC% -- set above from original picturee
  129. 2,3. Positioning on output object. Must be integer, in pixels.
  130. 4,5. Width, height of output image. Here we use the values set above.r
  131. 6, Source of image...in this case the memory image set by CreateCompatibleDC% function
  132. 7,8. Don't know. Set to 0 works just fine! Experiment and let me know.
  133. 9,10. X/Y coordinates for how much of original to put in new object. You can use
  134. these values for cropping, if you like..
  135. 11. SRCCOPY, as set in constants above. Change at own risk..
  136. *Reset scalemodes to previous inch valuess
  137. Command3_Click
  138. * Print all items other than the image first..
  139. Hello
  140. *After printing all other elements include your BMPP
  141. printing routine, as below.l
  142. * Print Scaled Image
  143. *Make certain we have valid scaling values
  144. *Set GDI Constants
  145. * StretchBlt requires pixel coordinates.
  146. *First two variables are the x,y coordinates (in Pixels)
  147. for the placement of images on the printed page. Since the
  148. form's ScaleMode is 5 for inches, multiply by 300 to
  149. match the the current inch positions of Picture2 onn
  150. the 300 DPI device.n
  151. *Second pair of variables set the height and width of thee
  152. graphic to match the pixel size of the original picturee
  153. in the invisible Picture1 box.
  154. *Do not change the order of these statements.a
  155. Variables for the StretchBlt function:
  156. 1. Source of image HMemeoryDC% -- set above from original picturec
  157. 2,3. Positioning on output object. Must be integer, in pixels.
  158. 4,5. Width, height of output image. Here we use the values set above.Y
  159. 6, Source of image...in this case the memory image set by CreateCompatibleDC% function
  160. 7,8. Don't know. Set to 0 works just fine! Experiment and let me know.
  161. 9,10. X/Y coordinates for how much of original to put in new object. You can use
  162. these values for cropping, if you like.r
  163. 11. SRCCOPY, as set in constants above. Change at own risk.w
  164. *Send image and text to printers
  165. Command4_Click
  166. Command5_Click
  167. HScroll1_Change
  168. *If the Move option is selected (default) then add the positive or
  169. negative Value of Hscroll1 to the top left of the picture,
  170. redraw. Notice that the multiplier is .01 to deal with the
  171. inch settings. Scroll Values must be integers., so we cane
  172. move in .01 inch increments.
  173. If the Size option is selected, then add the positive or
  174. negative Value of Hscroll1 to the scalex variable, thenn
  175. redraw. Notice that the multiplier is .01 to deal with the
  176. inch settings. Scroll Values must be integers., so we cann
  177. move in .01 inch increments.
  178. VScroll1_Change
  179. *See Hscroll1_Change for explanations.
  180.